<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/* ****************************************************************************
  NAIYUMIE KING WANG JJANG Front End Developer <naiyumie@gmail.com>
  FileType:CRLF, Encording:UTF-8, Tab&Space:4/4
  ------------------------------------------------------------------------
  TDD
**************************************************************************** */

class TmpMbStrSplitTest extends N_Controller {
	public function __construct(){
		parent::__construct();
	}
	function index(){
		$query = $this->db->query("SELECT `text` , `code`, `isAbsolute` FROM tbl_enum;");
		$result = $query->result_array();

		foreach($result as $key=>$val){
			//echo $val['text'];
			//echo mb_strlen($val['text']);
			//echo PHP_EOL;
			$whereVal = '여';
			$splitedString = preg_split('//u', $val['text'], -1, PREG_SPLIT_NO_EMPTY);
			foreach($splitedString as $k=>$v){
				echo $v . PHP_EOL;
				if(strpos($v, $whereVal) !== false){
					echo "True".PHP_EOL;
					//if($whereVal = ){}
					$whereVal = $val['code'];
					if($val['isAbsolute'] == 'y'){
						echo "absolute".PHP_EOL;
					}
				}
			}
		}
	}
}